//
//  ZhuyetableCell.m
//  Hand-held_kitchen
//
//  Created by 张张烨 on 16/1/25.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ZhuyetableCell.h"

@implementation ZhuyetableCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.contentView.userInteractionEnabled = YES;
        
        self.mingzi = [[UILabel alloc]init];
        _mingzi.font = [UIFont systemFontOfSize:14* KUAN];
        _mingzi.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:_mingzi];
        [_mingzi release];
        
        self.tupian = [[UIImageView alloc]init];
        [self.contentView addSubview:_tupian];
        [_tupian release];
        
        self.neirong = [[UILabel alloc]init];
        _neirong.textColor= [UIColor whiteColor];
        _neirong.font = [UIFont systemFontOfSize:14* KUAN];
        _neirong.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:_neirong];
        [_neirong release];
        
        self.tupian1 = [[UIImageView alloc]init];
        [self.contentView addSubview:_tupian1];
        [_tupian1 release];
        self.bofang1 = [[UIImageView alloc]init];
        _bofang1.image = [UIImage imageNamed:@"bofang"];
        [self.contentView addSubview:_bofang1];
        [_bofang1 release];
        self.button1 = [UIButton buttonWithType:(UIButtonTypeSystem)];
       
        [_button1 addTarget:self action:@selector(button1:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.contentView addSubview:_button1];
        
        self.tupian2 = [[UIImageView alloc]init];
        [self.contentView addSubview:_tupian2];
        [_tupian2 release];
        self.bofang2 = [[UIImageView alloc]init];
        _bofang2.image = [UIImage imageNamed:@"bofang"];
        [self.contentView addSubview:_bofang2];
        [_bofang2 release];
        self.button2 = [UIButton buttonWithType:(UIButtonTypeSystem)];
        self.button2.userInteractionEnabled = YES;
        [_button2 addTarget:self action:@selector(button2:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.contentView addSubview:_button2];
        
        self.tupian3 = [[UIImageView alloc]init];
        [self.contentView addSubview:_tupian3];
        [_tupian3 release];
        self.bofang3 = [[UIImageView alloc]init];
        _bofang3.image = [UIImage imageNamed:@"bofang"];
        [self.contentView addSubview:_bofang3];
        [_bofang3 release];
        self.button3 = [UIButton buttonWithType:(UIButtonTypeSystem)];
        self.button3.userInteractionEnabled = YES;
        [_button3 addTarget:self action:@selector(button3:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.contentView addSubview:_button3];
        
        self.tupian4 = [[UIImageView alloc]init];
        [self.contentView addSubview:_tupian4];
        [_tupian4 release];
        self.bofang4 = [[UIImageView alloc]init];
        _bofang4.image = [UIImage imageNamed:@"bofang"];
        [self.contentView addSubview:_bofang4];
        [_bofang4 release];
        self.button4 = [UIButton buttonWithType:(UIButtonTypeSystem)];
        self.button4.userInteractionEnabled = YES;
        [_button4 addTarget:self action:@selector(button4:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.contentView addSubview:_button4];
        
         self.tupian1.userInteractionEnabled = YES;
         self.tupian2.userInteractionEnabled = YES;
         self.tupian3.userInteractionEnabled = YES;
         self.tupian4.userInteractionEnabled = YES;
        
    }
    return self;
}
-(void)button1:(UIButton *)button
{
    [self.delegate button];
}

-(void)button2:(UIButton *)button
{
      [self.delegate2 button2];
}

-(void)button3:(UIButton *)button
{
      [self.delegate3 button3];
}

-(void)button4:(UIButton *)button
{
    self.button123456789(button);
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    
    
    _mingzi.frame = CGRectMake(0, 0, Width, 45 *GAO);
    _tupian.frame = CGRectMake(0, 45* GAO, Width/3, 160*GAO);
    _neirong.frame = CGRectMake(0, 135* GAO, Width/3, 30*GAO);
    _tupian1.frame = CGRectMake(Width/3, 45* GAO, (Width/3), 80*GAO);
//    _tupian1.contentMode = UIViewAnimationCurveEaseInOut;
    _bofang1.frame = CGRectMake(Width/3+(50 * KUAN), 70* GAO, 40* KUAN, 40 * GAO);
    _button1.frame= CGRectMake(Width/3, 45* GAO, (Width/3), 80 *GAO);
    
    _tupian2.frame = CGRectMake((Width/3)*2, 45 * GAO, Width/3, 80 *GAO);
    _bofang2.frame = CGRectMake((Width/3)*2 +(50*KUAN) , 70* GAO, 40* KUAN, 40 *GAO);
    _button2.frame = CGRectMake((Width/3)*2, 45 * GAO, Width/3, 80 * GAO);
    
    _tupian3.frame=CGRectMake(Width/3, 125 * GAO, Width/3, 80*GAO);
    _bofang3.frame = CGRectMake(Width/3+(50 * KUAN), 150*GAO, 40*KUAN, 40*GAO);
    _button3.frame=CGRectMake(Width/3, 125 * GAO, Width/3, 80 * GAO);
    
    _tupian4.frame =CGRectMake((Width/3)*2, 125*GAO, Width/3, 80 *GAO);
    _bofang4.frame = CGRectMake((Width/3)*2 +(50*KUAN), 150*GAO, 40*KUAN, 40*GAO);
    _button4.frame =CGRectMake((Width/3)*2, 125*GAO, Width/3, 80*GAO);
}





- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
